<!DOCTYPE html>
<html class="x-admin-sm">
    <head>
        <meta charset="UTF-8">
        <title>采购单详情</title>
        <meta name="renderer" content="webkit">
        <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
        <meta name="viewport" content="width=device-width,user-scalable=yes, minimum-scale=0.4, initial-scale=0.8,target-densitydpi=low-dpi" />
        <link rel="stylesheet" href="/static/css/font.css">
        <link rel="stylesheet" href="/static/css/xadmin.css">
		<link rel="stylesheet" href="/static/css/table.css">
        <script src="/static/lib/layui/layui.js" charset="utf-8"></script>
        <script type="text/javascript" src="/static/js/xadmin.js"></script>
        <script type="text/javascript" src="/static/js/jquery.min.js"></script>
        <!--[if lt IE 9]>
          <script src="https://cdn.staticfile.org/html5shiv/r29/html5.min.js"></script>
          <script src="https://cdn.staticfile.org/respond.js/1.4.2/respond.min.js"></script>
        <![endif]-->
    </head>
    <body>
        <div class="x-nav">
          <a class="layui-btn layui-btn-small" style="line-height:1.6em;margin-top:3px;float:right" onclick="location.reload()" title="刷新">
            <i class="layui-icon layui-icon-refresh" style="line-height:30px"></i></a>
        </div>
        <div class="layui-fluid">
            <div class="layui-row layui-col-space15">
                <div class="layui-col-md12">
                    <div class="layui-card">
                        {if condition="$purchase.state eq '1'"}
						<div class="layui-card-header">
                            <span>采购申请信息 </span>
							<button class="layui-btn" onclick="state('{$purchase.pur_order_id}','1')">同意</button>
                            <button class="layui-btn layui-btn-danger" onclick="state('{$purchase.pur_order_id}','2')">驳回</button>
						</div>
                        {/if}
                        <div class="layui-card-body">
                            <div class="layui-tab layui-tab-card" style="margin-bottom:15px;">
							  <ul class="order_table">
								<li>申请门店</li>
							  </ul>
							  <div class="layui-tab-content">
								 <span>申请门店：{$purchase.shop_id}</span>
							  </div>
							</div>
                            <div class="layui-tab layui-tab-card" style="margin-bottom:15px;">
							  <ul class="order_table">
								<li>产品信息</li>
							  </ul>
							  <div class="layui-tab-content">
								 <table class="layui-table">
                                    <tr>
                                        <td colspan='2'>产品名称：{$purchase.goods_name}</td>
                                    </tr>
                                    <tr>
                                        <td>产品分类：{$purchase.category_name}</td>
                                        <td>产品子分类：{$purchase.cat_name}</td>
                                    </tr>
                                    <tr>
                                        <td>产品品牌：{$purchase.brand_name}</td>
                                        <td>内存：{$purchase.memory_name}</td>
                                    </tr>
                                    <tr>
                                        <td>产品型号：{$purchase.marker}</td>
                                        <td>属性：{$purchase.attribute_name}</td>
                                    </tr>
                                    <tr>
                                        <td>产品颜色：{$purchase.colour_name}</td>
                                        <td></td>
                                    </tr>
                                 </table>
							  </div>
							</div>
							<div class="layui-tab layui-tab-card" style="margin-bottom:15px;">
							  <ul class="order_table">
								<li>采购数量</li>
							  </ul>
							  <div class="layui-tab-content">
								 <span>数量：{$purchase.number}</span>
								 <span style="margin-left:30px;">单位：{$purchase.unit}</span>
							  </div>
							</div>
							<div class="layui-tab layui-tab-card" style="margin-bottom:15px;">
							  <ul class="order_table">
								<li>产品进货价</li>
							  </ul>
							  <div class="layui-tab-content">
								 <span>进货单价：{$purchase.buying_price}元</span>
								 <span style="margin-left:30px;">进货总价：{$purchase.total_price}元</span>
							  </div>
							</div>
                            <div class="layui-tab layui-tab-card" style="margin-bottom:15px;">
							  <ul class="order_table">
								<li>产品供应商</li>
							  </ul>
							  <div class="layui-tab-content">
								 <span>供应商：{$purchase.supplier_name}</span>
							  </div>
							</div>
                            <div class="layui-tab layui-tab-card" style="margin-bottom:15px;">
							  <ul class="order_table">
								<li>采购备注</li>
							  </ul>
							  <div class="layui-tab-content">
								 
                                  {if condition="$purchase.remarks eq ''"}
                                <span>无</span>
                                {else /}
                                 <span>采购备注：{$purchase.remarks}</span>
                                 {/if}
							  </div>
							</div>
                            <div class="layui-tab layui-tab-card" style="margin-bottom:15px;">
							  <ul class="order_table">
								<li>审核状态</li>
							  </ul>
							  <div class="layui-tab-content">
								 <span>审核状态：{$purchase.states}</span>
							  </div>
							</div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
     <script>
        function state(id,ty)
        {
            parent.layer.confirm('你确定执行该操作吗?', function(){
                var params = {};
                params.id = id;
                params.ty = ty;
                $.ajax({
                    type: "POST",
                    url: "/shop/purchase/purstate.html",
                    cache: false, //禁用缓存
                    data: params, //传入组装的参数
                    dataType: "json",
                    success: function (result) {
                        if(result.code==10001){
                            parent.layer.msg('操作成功', {icon: 1});
                        }else{
                            parent.layer.msg(result.msg, {icon: 5});
                        }
                    },
                    error:function () {
                        parent.layer.msg('网络错误', {icon: 5});
                    }
                })
            });
        }
     </script>
    </body>
</html>